﻿using EasyNetQ;
using System;

namespace ConsoleAppRabbitmqPublish
{
    public class Program
    {
        public static void Main(string[] args)
        { 

            using (var bus = RabbitHutch.CreateBus("host=127.0.0.1;virtualHost=BuhlerSmar;username=guest;password=guest"))
            {
                var input = "";
                Console.WriteLine("Please enter a message. 'Quit' to quit.");
                while ((input = Console.ReadLine()) != "Quit")
                {
                    bus.PubSub.Publish(new TextMessage
                    {
                        Text = input
                    });
                }
            }


        }
    }
}
